import HTTP from '@/plugins/axios'
import { api } from '@/ts/enum'
import { dealRes, pageList } from '@/ts/type'
import { ClaimDto, DealClaim } from '@/ts/type/Claim'

const ClaimService = class ClaimService {
  static getAllInfo(page: number, size: number) {
    return HTTP.get<dealRes<pageList<ClaimDto>>>(`/${api.ClaimApi}/${page}/${size}`)
  }

  static putDealClaim(data: DealClaim) {
    return HTTP.put<dealRes<string>>(`/${api.ClaimApi}`, data)
  }

  static queryByStatus(page: number, size: number, data: DealClaim) {
    return HTTP.post<dealRes<pageList<ClaimDto>>>(`/${api.ClaimApi}/query/${page}/${size}`, data)
  }

  static postClaimDto(data: ClaimDto) {
    return HTTP.post<dealRes<string>>(`/${api.ClaimApi}`, data)
  }

  static getClaimDto() {
    return HTTP.get<dealRes<ClaimDto[]>>(`/${api.ClaimApi}`)
  }
}

export default ClaimService